//
// Created by xili on 2024/8/6 19:59.
// Go big or go home.
//
#include <iostream>
#include <unordered_set>

using namespace std;

class Solution {
public:
    int numberOfSpecialChars(string word) {
        unordered_set<char> us;
        int ans = 0;
        for (auto &item: word) {
            us.insert(item);
        }
        for (auto &item: us) {
            ans += islower(item) && us.count(toupper(item)) ? 1 : 0;
        }
        return ans;
    }
};